<html>
<head>
<title>pnotify - a portable filesystem event notifier</title>
</head>
<body>
<h1>pnotify</h1>
pnotify is an event notification framework for monitoring files and directories.
It is designed to be portable across different Unix-like operating systems, and currently
supports Linux and BSD.  The <a href="manpage.html">pnotify API</a> is very similar to the <a href="http://linux.die.net/man/7/inotify">inotify API</a> under Linux.

<center>
<hr width="50%">
<a href="#download">Download</a> | 
<a href="#docs">Documentation</a> | 
<a href="#mlist">Mailing list</a> 
<hr width="50%">

</center>

<h2>Rationale</h2>

Kernel-based filesystem event notification is a relatively new phenonemon, and several
different approaches have been taken by various operating systems. 
Linux uses inotify, BSD uses kqueue, Apple has kqueue and it's own Spotlight system calls, Solaris has FEM, Windows has the NTFS Change Journal and the ReadDirectoryChangesW function, and so forth.
<p>
The goal of pnotify is to provide a simple, cross-platform API for monitoring filesystem
events.  The library will conceal all of the messy implementation-specific details from the user and help them to write more portable programs.

<h2>History</h2>

pnotify was born out of an effort to port the inotify API from Linux
to BSD. This initial effort took the form of a userspace library that would translate
inotify requests into their kqueue(4) equivalent. After some time, it became clear that 
kqueue was not sophisticated enough to support all of the functionality of inotify.
There was also the problem of threadsafety; inotify relies on shared global data
structures, which is normal within the kernel but complicates the design of a userspace library.
<p>
Eventually, it became clear that a new API was needed to address these portability and threadsafety issues. This new API became 'pnotify', to indicate that it is a portable subset of the
inotify API.  

<h2>Supported Platforms</h2>

pnotify has been ported to the following platforms:

<ul>
<li>Linux 2.6
<li>OpenBSD 4.0
<li>NetBSD 3.1
<li>FreeBSD 6.2
<li>MacOS/X 10.4
</ul>

There are platforms that are not supported due to lack of developer resources.
Interested parties with access to these platforms are encouraged to port
the library to their platform. For example:

<p>
<ul>
<li>Sun OpenSolaris will soon get a similar API called FEM that could be supported.
<li>Microsoft Windows has a filesystem event notification mechanism
</ul>
<p>
At the current time, there is no generic polling mechanism to use as a fallback
for systems that don't have a kernel event mechanism like inotify or kqueue.

<h2>Usage</h2>

When you run './configure && make && make install', pnotify is built
as a shared library and installed under the /usr/local prefix.
<p>
Even though pnotify is built as a shared library by default, 
it is easier for application developers to include
pnotify.c and pnotify.h in their source tree and not depend
on the existence of a shared library. 

<a name="download">
<h2>Download</h2>
</a>

The source code may be downloaded from the <a href="http://code.google.com/p/pnotify/downloads/list">download page</a>. You may also check out a working copy of the latest
development sources by issuing the following command:
<p>
<code>
svn checkout http://pnotify.googlecode.com/svn/trunk/ pnotify
</code>
<p>
If you just want a quick peek at the source code, you can browse the <a href="http://pnotify.googlecode.com/svn/trunk/">webSVN repository</a>

<a name="docs">
<h2>Documentation</h2>
</a>
<ul>
<li>The pnotify(3) manpage in the following formats:<br>
	<ul>
	<li><a href="manpage.html">HTML</a></li>
	<li><a href="manpage.ps">PostScript</a>
	<li><a href="manpage.pdf">PDF</a>
	</ul>
</li>
<li>Future development will include support for non-blocking I/O syscalls. To see 
what this will look like, check out <a href="http://pnotify.googlecode.com/svn/trunk/nio.h">nio.h</a>
<li>Doxygen-generated <a href="doxygen/html/files.html">annotated data structures and function reference</a>.
</ul>

<a name="mlist"></a>
<h2>Mailing List</h2>

There is a mailing list for discussion about the pnotify library. Click
<a href="http://groups.google.com/group/pnotify/topics">here</a> to sign up,
post a question or comment, or browse through the archives.

<h2>Contact the Author</h2>

For more information, contact Mark Heily at <a href="mailto:devel@heily.com">devel@heily.com</a>

<h2>Related Links</h2>

<ul>
<li><a href="http://oss.sgi.com/projects/fam/">FAM</a> - the original, unmaintained monitoring utility from SGI.
<li><a href="http://www.gnome.org/~veillard/gamin/">gamin</a> - the modern FAM replacement. Part of the GNOME project.
<li><a href="http://monkey.org/~provos/libevent/">libevent</a> - a library for building event-driven servers. Supports socket events, but not filesystem events.
</ul>
<hr>
(C) 2007 Mark Heily.
</body>
</html>
